#define _CRT_SECURE_NO_WARNINGS
#include"SList.h"

#define MALLOCNODE(node)                           \
SLTNode* node = (SLTNode*)malloc(sizeof(SLTNode)); \
if (NULL == node)                                  \
{                                                  \
	perror("malloc node");                         \
	exit(-1);                                      \
}                                                  \

void test1()
{
	MALLOCNODE(node1);
	MALLOCNODE(node2);
	MALLOCNODE(node3);
	MALLOCNODE(node4);

	node1->next = node2;
	node2->next = node3;
	node3->next = node4;
	node4->next = NULL;

	SLTNode* plist = node1;

	SLTprint(plist);
}
void test2()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTDelBack(&plist);
	SLTprint(plist);

	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushFront(&plist, 6);
	SLTprint(plist);
	SLTDelFront(&plist);
	SLTprint(plist);
}

void test3()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushFront(&plist, 6);
	SLTprint(plist);
	SLTDestory(&plist);
	SLTprint(plist);

}

int main()
{
	//test1();
	//test2();
	test3();
	return 0;
}

